#include "mylist.h"

List CreatLink(){
    Node* head_ = (Node*)malloc(sizeof(Node));
    if(NULL == head_) {
        return NULL;
    } else {
        head_ -> next = NULL;
        head_ -> value = 0;
        return head_;
    }
}

int AppendNode(List head, Node * node) {
    Node* p = head;
    while(p->next != NULL){
        p = p->next;
    }
    p->next = node;
    return 0;
}

Node* InputNode(){
    Node * node = (Node*)malloc(sizeof(Node));
    if(NULL != node){
        node->next = NULL;
        scanf("%d", &node->value);
    }
    return node;
}